# Removing abbreviations and authortags -> some politicians use their initials to
# indicate authorship and this heavily clusters and biases
#dfc<-dfm_select(dfc,featnames(dfc)[nchar(featnames(dfc))>3])
dfg_tw<-dfm_group(dfc,group='fullname',fill=T)
library(lubridate)
docvars(dfc,"time")<-as.Date(docvars(dfc,"created_at"))
week<-round_date(docvars(dfc,"time"),"week")
docvars(dfc,"week")<-week
docvars(dfc,"partyweek")<-paste0(docvars(dfc,"party"),"-",week)
docvars(dfc,"week")<-week
docvars(dfc,"partyweekwin")<-paste0(docvars(dfc,"party"),"-",week,"-",docvars(dfc,"winner"))
month<-round_date(docvars(dfc,"time"),"month")
docvars(dfc,"month")<-month
docvars(dfc,"partymonth")<-paste0(docvars(dfc,"party"),"-",month)
source("./tools/toolbox.R")
load("us_dfm.rdata")
# Removing abbreviations and authortags -> some politicians use their initials to
# indicate authorship and this heavily clusters and biases
#dfc<-dfm_select(dfc,featnames(dfc)[nchar(featnames(dfc))>3])
dfg_tw<-dfm_group(dfc,group='fullname',fill=T)
library(lubridate)
docvars(dfc,"time")<-as.Date(docvars(dfc,"created_at"))
week<-round_date(docvars(dfc,"time"),"week")
docvars(dfc,"week")<-week
docvars(dfc,"partyweek")<-paste0(docvars(dfc,"party"),"-",week)
docvars(dfc,"week")<-week
docvars(dfc,"partyweekwin")<-paste0(docvars(dfc,"party"),"-",week,"-",docvars(dfc,"winner"))
month<-round_date(docvars(dfc,"time"),"month")
docvars(dfc,"month")<-month
docvars(dfc,"partymonth")<-paste0(docvars(dfc,"party"),"-",month)
dfg_tw<-dfm_group(dfc,group='partyweek',fill=T)
#dfg_tw<-dfm_group(dfc,group='partymonth',fill=T)
source("./tools/toolbox.R")
